package cn.sdormitory.controller;

import cn.sdormitory.common.api.CommonResult;
import cn.sdormitory.service.AppDictDetailService;
import cn.sdormitory.sys.entity.SysDictDetail;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: lx
 * @date: 2023/9/8 15:13
 * @description:
 */
@RestController
@RequestMapping("/app/dict/detail")
@Api("数据字典接口")
public class AppDictDetailController {

    @Autowired
    AppDictDetailService appDictDetailService;

    @GetMapping("/getDictByType")
    public CommonResult getDictByType(String dictType){
        List<SysDictDetail> sysDictDetails = appDictDetailService.selectDictDataByType(dictType);
        return CommonResult.success(sysDictDetails);
    }
}
